package com.cmcc.groupcontacts.firewall.dao.model;

import android.content.ContentValues;

/**
 * 黑白名单数据模型
 * 
 * @author 
 * 
 */
public class FilterListVO extends BaseModel {
	private static final long serialVersionUID = 4417823497253812283L;

	/** 任意名单 */
	public static final int TYPE_ALL = -1;
	/** 黑名单 */
	public static final int TYPE_BLACK = 0;
	/** 白名单 */
	public static final int TYPE_WHITE = 1;
	/** 黑名单 地区*/
	public static final int TYPE_BLACK_AREA = 2;
	/** 黑名单   区号*/
	public static final int TYPE_BLACK_AREA_CODE = 3;
	/** 不拦截 */
	public static final int STATE_NO_BLOCK = 0;
	/** 拦截 */
	public static final int STATE_BLOCK = 1;

	private Integer id;
	private String number;
	private String name;
	private int type;
	private int callState;
	private int smsState;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getCallState() {
		return callState;
	}

	public void setCallState(int callState) {
		this.callState = callState;
	}

	public int getSmsState() {
		return smsState;
	}

	public void setSmsState(int smsState) {
		this.smsState = smsState;
	}

	public static class MetaData {
		public static final String ID = "id";
		public static final String NUMBER = "number";
		public static final String NAME = "name";
		public static final String TYPE = "type";
		public static final String CALL_STATE = "call_state";
		public static final String SMS_STATE = "sms_state";
		public static final String[] ALL_COLS = { ID, NUMBER, NAME, TYPE, CALL_STATE, SMS_STATE };
		public static String CREATE_DDL = "CREATE TABLE filter_list (id INTEGER PRIMARY KEY,number TEXT,name TEXT,type INTEGER,call_state INTEGER,sms_state INTEGER);";
	}

	@Override
	public ContentValues parse2ContentValues() {
		putValue(MetaData.ID, id);
		putValue(MetaData.NUMBER, number);
		putValue(MetaData.NAME, name);
		putValue(MetaData.TYPE, type);
		putValue(MetaData.CALL_STATE, callState);
		putValue(MetaData.SMS_STATE, smsState);
		return contentValues;
	}
}
